package com.ny.controller;

import com.ny.entity.Result;
import com.ny.entity.User;
import com.ny.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    private EmailService emailService;

    @GetMapping("/test/sendEmail")
    public Result testSendEmail(String toEmail) {
        emailService.sendEmail(toEmail, emailService.getCode());
        return Result.success("测试发送成功");
    }
}
